// import React, { Component, createContext } from "react";
// const { Consumer } = createContext();

import React, { Component } from "react";
// import { Consumer } from "./App";
import { appContext } from "./App";

class Child2 extends Component {
  state = {};
  render() {
    return (
      <>
        <span>child2组件</span>
        <appContext.Consumer>
          {(value) => {
            return (
              <span>
                {value.name} - {value.count}
              </span>
            );
          }}
        </appContext.Consumer>
      </>
    );
  }
}

export default Child2;
